import { createStore } from "vuex";
import user from './modules/user'
//创建一个新的store实例

const store = createStore({
    modules:{
        user
    },
    state:{
        routeLoaded:false,
        firstRoute:null,
        menuTree:null
    },
    mutations:{
        setRouteLoaded(state,loaded){
            state.routeLoaded=loaded;
        },
        setFirstRoute(state,route){
            state.firstRoute=route;
        },
        setMenuTree(state,data){
            state.menuTree=data;
        }
    },
})

export default store